<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">

	<ui:composition template="/templates/form.xhtml">
			<ui:define name="title">SIA Online</ui:define>
			<ui:define name="header">Data Jurusan</ui:define>
			<ui:define name="body">
				<h:form id="data" onkeypress="if(event.keyCode==13)return false;">
					<h:commandButton value="Tambah Jurusan" action="#{jurusan.add}" styleClass="btn btn-sm btn-primary"/>&nbsp;
					<h:commandButton value="Reload Data" action="#{jurusan.reload}" styleClass="btn btn-sm btn-info">
<!-- 						<f:ajax render=":message"/> -->
					</h:commandButton>
					<br/><br/>
					<h:dataTable id="datatable" binding="#{jurusan.htmldatatable}" value="#{jurusan.datatable.dataRows}" var="var" styleClass="table table-bordered table-striped datatable">
						<h:column>
							<f:facet name="header">ID Jurusan</f:facet>
							#{var[0]}
						</h:column>
						<h:column>
							<f:facet name="header">Nama Jurusan</f:facet>
							#{var[1]}
						</h:column>
						<h:column>
							<f:facet name="header">Action</f:facet>
							<h:outputLink value="#{jurusan.edit()}" styleClass="btn btn-xs btn-warning">
								Edit
								<f:param name="idjurusan" value="#{var[0]}"/>
							</h:outputLink>&nbsp;
							<h:commandButton value="delete" action="#{jurusan.delete}" onclick="if(!confirm('Apakah anda yakin menghapus data ini?'))return false;" styleClass="btn btn-xs btn-danger">
<!-- 								<f:ajax render=":message"/> -->
							</h:commandButton>
						</h:column>
					</h:dataTable>
				</h:form>
			</ui:define>
	</ui:composition>
</html>